const BASE_URL = 'http://123.207.32.32:9001'
class XRequest{
      request(url,method,args){
          return new Promise((resolve,reject)=>{
            wx.request({
              url:BASE_URL+url,
              method,
              data:args,
              success:(res)=>{
                  resolve(res)
              },
              fail:(err)=>{
                  reject(err)
              }
            })
          })
      }
      get(url,args){
        return this.request(url,'GET',args)
      }
      post(url,args){
        return this.request(url,'POST',args)
      }
}

const xRequest =new XRequest()
export default xRequest